import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Home from '@/views/home.vue'
import Search from '@/views/search.vue'
import Zixun from '@/views/zixun.vue'
import Mine from '@/views/mine.vue'
import Login from '@/views/login.vue'
import Registered from '@/views/registered.vue'
import Citylist from '@/views/city-list.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: 'home', component: Home },
      { path: 'search', component: Search },
      { path: 'zixun', component: Zixun },
      { path: 'mine', component: Mine }
    ]
  },
  { path: '/login', component: Login },
  { path: '/registered', component: Registered },
  { path: '/citylist', component: Citylist }
]

const router = new VueRouter({
  routes
})

export default router
